﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="org-list.aspx.cs" Inherits="SsWeb._console.core.org_list" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body style="margin:0px; padding:0px;">
    <form id="form1" runat="server">
    <div>
        <a href="role-list.aspx">
            角色列表
        </a>
        <a href="user-list.aspx">
            用户列表
        </a>
    </div>
    <h1>组织机构信息</h1>
    <div>
        <h2>导入组织机构</h2>
        <label>上传.xml文件</label><asp:FileUpload ID="_ctlFileXml" runat="server" /><br />
        <asp:LinkButton ID="_ctlBtnImport" runat="server" onclick="_ctlBtnImport_Click">上传导入</asp:LinkButton>
    </div>
    <div>
        <h2>导入用户和组织机构的对应关系</h2>
        <em>在执行此操作前,请先导入用户数据!</em><br />
        <label>上传.xml文件</label><asp:FileUpload ID="_ctlFileXmlMember" runat="server" /><br />
        <asp:LinkButton ID="_ctlBtnImportMember" runat="server" 
            onclick="_ctlBtnImportMember_Click">上传导入</asp:LinkButton>
    </div>
    <div>
        <label>
            父部门</label>
        <asp:TextBox ID="_ctlEditParent" runat="server" ReadOnly="true"></asp:TextBox>
        <asp:LinkButton ID="_ctlReset" runat="server" Text="清空" OnClick="_ctlReset_Click" /><br />
        <label>
            名称</label>
        <asp:TextBox ID="_ctlEditCaption" runat="server"></asp:TextBox><br />
        <label>
            Code</label>
        <asp:TextBox ID="_ctlEditCode" runat="server"></asp:TextBox><br />
        <asp:Button ID="_ctlBtnSave" runat="server" Text="保存" OnClick="_ctlBtnSave_Click" />
    </div>
    <div>
        <asp:TreeView ID="_ctlTreeOrg" runat="server">
            <SelectedNodeStyle BackColor="ActiveBorder" />
        </asp:TreeView>
    </div>
    <div style="width:50%; float:left;">
        <b>已分配的用户</b>
        <div>
            <asp:Button ID="_ctlBtnRemoveUser" runat="server" Text="移除用户" OnClick="_ctlBtnRemoveUser_Click" />
        </div>
        <asp:Repeater ID="_ctlGridSelectedUsers" runat="server">
            <HeaderTemplate>
                <table>
                    <tr>
                        <th>
                            -
                        </th>
                        <th>
                            Name
                        </th>
                        <th>
                            Account
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:CheckBox ID="_ctlCheck" runat="server" />
                        <asp:HiddenField ID="_ctlTag" runat="server" Value='<%# Eval("UserId") %>' />
                    </td>
                    <td>
                        <%# Eval("User.Name") %>
                    </td>
                    <td>
                        <%# Eval("User.Account") %>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    
    <div style="width:50%; float:left;">
        <b>用户列表</b>
        <div>
            <asp:Button ID="_ctlBtnAssign" runat="server" Text="分配" OnClick="_ctlBtnAssign_Click" />
            <asp:TextBox ID="_ctlEditFilter" runat="server"></asp:TextBox>
            <asp:Button ID="_ctlBtnSearch" runat="server" Text="查询" OnClick="_ctlBtnSearch_Click" />
        </div>
        <asp:Repeater ID="_ctlGridUser" runat="server">
            <HeaderTemplate>
                <table>
                    <tr>
                        <th>
                            -
                        </th>
                        <th>
                            Name
                        </th>
                        <th>
                            Account
                        </th>
                        <th>
                            Email
                        </th>
                        <th>
                            Telephone
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:CheckBox ID="_ctlCheck" runat="server" />
                        <asp:HiddenField ID="_ctlTag" runat="server" Value='<%# Eval("Id") %>' />
                    </td>
                    <td>
                        <%# Eval("Name") %>
                    </td>
                    <td>
                        <%# Eval("Account") %>
                    </td>
                    <td>
                        <%# Eval("Email") %>
                    </td>
                    <td>
                        <%# Eval("Telphone") %>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    </form>
</body>
</html>
